package cn.kgc.javaweb.service;

import cn.kgc.javaweb.entity.User;
import cn.kgc.javaweb.mapper.UserMapper;
import cn.kgc.javaweb.utils.MapperUtil;

/**
 * @author: mosin
 * @version: v1.0  2022/6/25
 */

public class UserServiceImpl  implements UserService{

    private UserMapper userMapper = MapperUtil.getSqlSession().getMapper(UserMapper.class);
    @Override
    public Boolean selectByUser(User user) {

        User usr = userMapper.selectByUser(user);

        return usr!=null;
    }

    @Override
    public Boolean addUser(User user) {

       Integer line =  userMapper.insertUser(user);
        return line>0;
    }
}
